package com.scau.meetingbook.utils;
import org.springframework.stereotype.Component;

import java.time.LocalDate;
import java.time.LocalTime;
import java.time.ZoneId;
import java.util.Date;

@Component
public class TimeConverter {
    public Date convertStringToDate(String timeString) {
        // 解析字符串为LocalTime
        LocalTime localTime = LocalTime.parse(timeString);
        // 转换为Date（添加系统默认时区）
        return Date.from(localTime.atDate(LocalDate.now())
                .atZone(ZoneId.systemDefault())
                .toInstant());
    }
}
